package com.li.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.Date;

@Data
public class User {
    private Long id;

    private String username;

    @JsonIgnore //不参与JSON序列化
    private String password;

    private String nickname;

    private String phoneNum;

    private String email;

    private Byte gender;
    
    @JsonIgnore //不参与JSON序列化
    private String salt;
    
    @JsonInclude (JsonInclude.Include.ALWAYS)
    private String avatarUrl;

    private Integer articleCount;

    private Byte isAdmin;

    private String remark;

    private Byte state;
    
    @JsonIgnore //不参与JSON序列化
    private Byte deleteState;

    private Date createTime;

    private Date updateTime;
    
    public User(String username, String nickname, String password, String salt) {
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.salt = salt;
    }
    
    public User() {
    }
    
    public User(String username, String password) {
        this.password = password;
        this.username = username;
    }
}